package com.briup.estore.common.pojo;

import com.briup.estore.common.utils.MakeIDUtils;

import java.sql.Timestamp;

/**
 * @Author briup-adam
 * @Date 2023/7/31 上午11:09
 * @Description 订单实体类
 **/

public class Order {
    /**
     * 订单编号
     */
    private String id;

    /**
     * 下单用户
     */
    private int userId;

    /**
     * 创建订单时间
     */

    private Timestamp createDate;

    /**
     * 支付方式
     */
    private String payWay;

    /**
     * 快递单号
     */
    private String trackingNumber;

    /**
     * 配送方式
     */
    private String distributionMode;

    /**
     * 订单状态
     * 1.已创建未支付
     * 2.已支付未发货
     * 3.已发货未收货
     * 4.已收货
     * 5.已关闭 只能关闭 已创建未支付的订单
     */
    private int status;

    /**
     * 支付时间
     */
    private Timestamp payDate;

    /**
     * 收件人
     */
    private String receiveUsername;

    /**
     * 收获地址
     */
    private String receiveAddress;

    /**
     * 收件人电话
     */
    private String receivePhone;


    public Order() {
       this.id= MakeIDUtils.generateOrderID();
        this.createDate = new Timestamp(System.currentTimeMillis());
        this.status=1;

    }

    @Override
    public String toString() {
        return "Order{" +
                "id='" + id + '\'' +
                ", userId=" + userId +
                ", createDate=" + createDate +
                ", payWay='" + payWay + '\'' +
                ", trackingNumber=" + trackingNumber +
                ", distributionMode='" + distributionMode + '\'' +
                ", status=" + status +
                ", payDate=" + payDate +
                ", receiveUsername='" + receiveUsername + '\'' +
                ", receiveAddress='" + receiveAddress + '\'' +
                ", receivePhone='" + receivePhone + '\'' +
                '}';
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Timestamp getCreateDate() {
        return createDate;
    }


    public String getPayWay() {
        return payWay;
    }

    public void setPayWay(String payWay) {
        this.payWay = payWay;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getTrackingNumber() {
        return trackingNumber;
    }

    public void setTrackingNumber(String trackingNumber) {
        this.trackingNumber = trackingNumber;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getDistributionMode() {
        return distributionMode;
    }

    public void setDistributionMode(String distributionMode) {
        this.distributionMode = distributionMode;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Timestamp getPayDate() {
        return payDate;
    }


    public String getReceiveUsername() {
        return receiveUsername;
    }

    public void setReceiveUsername(String receiveUsername) {
        this.receiveUsername = receiveUsername;
    }

    public String getReceiveAddress() {
        return receiveAddress;
    }

    public void setReceiveAddress(String receiveAddress) {
        this.receiveAddress = receiveAddress;
    }

    public String getReceivePhone() {
        return receivePhone;
    }

    public void setReceivePhone(String receivePhone) {
        this.receivePhone = receivePhone;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    public void setPayDate(Timestamp payDate) {
        this.payDate = payDate;
    }
}
